import java.util.PriorityQueue;
import java.util.Scanner;

public class problem3 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(), k = in.nextInt();
        long sum = 0,x;
        PriorityQueue<Integer> heap = new PriorityQueue<>((a, b) -> b-a );
        //PriorityQueue<Integer> heap = new PriorityQueue<>((a,b) -> Integer.compare(b,a));

        for(int i = 0; i < n; i++) {
            x = in.nextLong();
            sum += x;
            if(x % 2 == 0) {
                heap.add((int)x);
            }
        }

        while(!heap.isEmpty() && k-- != 0) {
            long t = heap.poll() / 2;
            sum -= t;
            if(t % 2 == 0) {
                heap.add((int)t);
            }
        }
        System.out.println(sum);
    }
}
